home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UTIL / MEMORY / VIRTUASRC / !Virtual / printf / c / cprintf
Text File  |  1993-03-30  |  1KB  |  62 lines

  1. /*
  2.      Module wrapping for FS
  3.      Source for printf module code
  4.      Version 0.01 (30-Mar-93)
  5.      By Brian Brunswick & Nick Smith, 1991-3
  6. */
  7.  
  8. #include <stdlib.h>
  9. #include "kernel.h"
  10.  
  11. /*
  12.         This is the finalisation code
  13. */
  14. static void fs_finalise(void)
  15. {
  16.         _kernel_swi_regs r;
  17.         r.r[0] = 0;             /* To keep compiler quiet */
  18. }
  19.  
  20. /*
  21.         This is the initialisation code
  22. */
  23. _kernel_oserror *fs_initialise(char *cmd_tail,
  24.                 int podule_base, void *private_word)
  25. {
  26.         _kernel_oserror *err = NULL;
  27.         /*
  28.                 These keep the compiler quiet.
  29.         */
  30.         cmd_tail = cmd_tail;
  31.         podule_base = podule_base;
  32.         private_word = private_word;
  33.  
  34.         if ( !err )
  35.           atexit( fs_finalise );
  36.  
  37.         return err;
  38. }
  39.  
  40. /*
  41.         This is the SWI handler
  42. */
  43. _kernel_oserror *fs_swi(int swi_number,
  44.                 _kernel_swi_regs *r, void *private_word)
  45. {
  46.         _kernel_oserror *err = NULL;
  47.  
  48.         r = r;
  49.         private_word = private_word;
  50.  
  51.         switch ( swi_number )
  52.         {
  53.         case 0:
  54.                 printf(*r);
  55.         default:
  56.                 err = NULL;
  57.                 break;
  58.         }
  59.  
  60.         return err;
  61. }
  62.